# Dockerfile for microservices-spring-cloud-app
# Build with:
# docker build -t microservices-spring-cloud-app .
# Run with:
# docker run -p 19090:19090 -d -v /tmp/logs:/opt/logs --name microservices-spring-cloud-app microservices-spring-cloud-app

# FROM docker.apiacmed.com/acmedback/acmedcare-spark:2.4.3
# MAINTAINER Stefan.Gu

# ENV VERSION 0.1.0.BUILD-SNAPSHOT

# RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
#   && echo "Asia/Shanghai" > /etc/timezone

FROM docker.apiacmed.com/acmedback/kernel:0.1.0
MAINTAINER Stefan.Gu
ENV VERSION 0.3.0.BUILD-SNAPSHOT

RUN echo "http://mirrors.aliyun.com/alpine/v3.6/main" > /etc/apk/repositories \
    && echo "http://mirrors.aliyun.com/alpine/v3.6/community" >> /etc/apk/repositories \
    && apk update upgrade \
    && apk add --no-cache procps unzip curl bash tzdata \
    && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone

ADD exchange-center-executor-${VERSION}.zip /exchange-center-executor/exchange-center-executor-${VERSION}.zip
ADD exchange-center-jmx-server-0.3.0.BUILD-SNAPSHOT-jar-with-dependencies.jar /exchange-center-jmx/exchange-center-jmx-server-0.3.0.BUILD-SNAPSHOT-jar-with-dependencies.jar

RUN unzip /exchange-center-executor/exchange-center-executor-${VERSION}.zip -d /exchange-center-executor \
    && rm -rf /exchange-center-executor/exchange-center-executor-${VERSION}.zip

ENV ServiceRoot /exchange-center-executor
ENV ControlCenterAddress 172.172.2.125:9998
#RUN tar zxvf spark-2.4.3-bin-hadoop2.7.tgz -C /exchange-center-executor/bin

CMD ["sh","/go/startup.sh"]